home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 974 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.0 KB  |  69 lines

  1. Path: cs.mu.OZ.AU!bounce-back
  2. From: Alexander Krotoff <krotoff@boy.nmd.msu.ru>
  3. Newsgroups: comp.std.c++
  4. Subject: Exception handling specs incomplete ?
  5. Date: 05 Apr 96 17:49:06 GMT
  6. Organization: -
  7. Approved: fjh@cs.mu.oz.au
  8. Message-ID: <199604051329.RAA04194@boy.nmd.msu.ru>
  9. Reply-To: krotoff@such.srcc.msu.su
  10. NNTP-Posting-Host: mundook.cs.mu.oz.au
  11. X-Original-Date: Fri, 5 Apr 1996 17:29:46 +0400 (????)
  12. X-Mailer: ELM [version 2.4 PL24]
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBFAgUBMWVdI+EDnX0m9pzZAQFrjgGAhU12fbbUBTe3v64fDC51ZDuQvntUrlcT
  15.     y1osLWfdBaW9TMtPF9oC//I29HrEOegx
  16.     =sKic
  17. Originator: fjh@mundook.cs.mu.OZ.AU
  18.  
  19. Hello c++ gurus,
  20.  
  21. I have two notes, about the behavior not specifed in the Jan 96 WP.
  22.  
  23. 1) While stack unwinding the destructor (or function indirectly called from
  24. the destructor) may try to do throw.
  25.  
  26. As seems to me WP says nothing about this case. Is it allowed ?
  27. Is the behavior specified for this case ?
  28.  
  29. Example:
  30.  
  31. struct A {
  32.     ~A () { throw 1; }
  33. };
  34.  
  35. void f ()
  36. {
  37.     A a;
  38.  
  39.     throw 2;
  40. }
  41.  
  42. main ()
  43. {
  44.     f();
  45. }
  46.  
  47. While stack unwinding control may come into the try-block.
  48. Is it allowed ?
  49. Shall this try-block hanlers be ignored ?
  50.  
  51. 2) While stack unwinding the destructor may attempt to create
  52. new objects, or arrays of class objects with non-trivial destructors
  53. via operator new. Shall this outside exception affect creation of
  54. new objects ? (Inner exception will cause destructor calls for all
  55. already created base classes sub-objects and completely created array
  56. elements.
  57.  
  58. Thank you in advance,
  59. --
  60. Alexander N. Krotoff        krotoff@such.srcc.msu.su
  61. Research Computer Center    tel: +7(095)939-2638
  62. Moscow State University        fax: +7(095)939-4430
  63. ---
  64. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  65. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  66. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  67. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  68. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  69.